package org.redmagic.agent.location.commandline;

import java.util.Properties;
import java.util.Set;

import javax.annotation.Nonnull;

import org.redmagic.location.Location;

public class CommandLineLocation implements Location {
    
    public CommandLineLocation() {
        
    }

    @Override
    @Nonnull
    public Properties resolvePlaceholders(Set<String> placeholders) {
        
        Properties systemProperties = System.getProperties();
        Properties resolvedProperties = new Properties();
        
        for (String placeholder : placeholders) {
            if (systemProperties.containsKey(placeholder)) {
                resolvedProperties.put(placeholder, systemProperties.get(placeholder));
            }
        }
        
        return resolvedProperties;
    }

    @Override
    public void postProcess(Properties properties) {
        
    }

    @Override
    public String toString() {
        return "CommandLineLocation";
    }
}
